﻿#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include "hiredis/hiredis.h"

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

enum LOG_TYPE
{
    INFO_LOG,
    ERROR_LOG,
    OUTPUT_LOG,
};

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();

    void            addLog(int nType, QString str);
    void            addCommandLog(QString str);
    bool            tryConnect();

private slots:
    void            on_pushButton_clicked();
    void            on_pushButton_9_clicked();
    void            on_pushButton_2_clicked();
    void            on_pushButton_3_clicked();
    void            on_pushButton_4_clicked();
    void            on_pushButton_5_clicked();
    void            on_pushButton_6_clicked();
    void            on_pushButton_7_clicked();
    void            on_pushButton_8_clicked();


private:
    Ui::Widget *    ui;
    bool            _isConnect;
    redisContext *  _ctx;
    redisReply *    _reply;
};
#endif // WIDGET_H
